Skip to content

TFM bounds checks for safety#10964

Open
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:tfm_fixes_1
Open

TFM bounds checks for safety#10964
SparkiDev wants to merge 1 commit into
wolfSSL:masterfrom
SparkiDev:tfm_fixes_1

Conversation

@SparkiDev

Copy link
Copy Markdown
Contributor

Description

fp_to_unsigned_bin_len did not deal with negative input length - fails early now. No code in wolfSSL calls mp_to_unsigned_bin_len with a negative len.

fp_is_bit_set and fp_set_bit check for greater than or equal to FP_MAX_BITS instead of just greater. Check doesn't cause issues as FP_MAX_SIZE has padding but it was the wrong check.

Testing

Tested with --enable-fastmath.

@SparkiDev SparkiDev self-assigned this Jul 21, 2026
fp_to_unsigned_bin_len did not deal with negative input length - fails early
now. No code in wolfSSL calls mp_to_unsigned_bin_len with a negative len.

fp_is_bit_set and fp_set_bit check for greater than or equal to FP_MAX_BITS
instead of just greater. Check doesn't cause issues as FP_MAX_SIZE has padding
but it was the wrong check.
@SparkiDev

Copy link
Copy Markdown
Contributor Author

Jenkins: retest this please

Visual Studio: remote connection dropped

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10964

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@SparkiDev SparkiDev assigned wolfSSL-Bot and unassigned wolfSSL-Bot Jul 23, 2026

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants